package com.bestcem.xm.survey.mq.receiver.biz;

import com.alibaba.fastjson.JSONObject;
import com.bestcem.xm.survey.mq.dto.CreateColumnsDto;
import com.bestcem.xm.survey.mq.dto.CreateQuotaDto;
import com.bestcem.xm.survey.service.SurveyMessageReceiverService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ReceiverService {
    private final SurveyMessageReceiverService surveyMessageReceiverService;

    public ReceiverService(SurveyMessageReceiverService surveyMessageReceiverService) {
        this.surveyMessageReceiverService = surveyMessageReceiverService;
    }

    public void clearRspdPropCache(GenericMessage<JSONObject> msg) {
        surveyMessageReceiverService.clearRspdPropCache(msg.getPayload());
    }

    public void surveyCreateColumns(GenericMessage<CreateColumnsDto> msg) {
        surveyMessageReceiverService.surveyCreateColumns(msg.getPayload());
    }

    public void surveyAddQuote(GenericMessage<CreateQuotaDto> msg) {
        surveyMessageReceiverService.surveyAddQuote(msg.getPayload());
    }

    public void surveyPopQuote(GenericMessage<CreateQuotaDto> msg) {
        surveyMessageReceiverService.surveyPopQuote(msg.getPayload());
    }

    public void surveyRespondentStatusChanged(GenericMessage<JSONObject> msg) {
        surveyMessageReceiverService.surveyRespondentStatusChanged(msg.getPayload());
    }

    public void respondentNumSubmit(GenericMessage<JSONObject> msg) {
        surveyMessageReceiverService.respondentNumSubmit(msg.getPayload());
    }

    public void createFootprint(GenericMessage<JSONObject> msg) {
        surveyMessageReceiverService.createFootprint(msg.getPayload());
    }
}